var a, b;
var c = "0xe2178b5a8a308922c97c69f7354acff525f2f3d7";
var d = [{
	"constant": false,
	"inputs": [{
		"name": "_itemIds",
		"type": "uint256[]"
	}, {
		"name": "_price",
		"type": "uint256"
	}, {
		"name": "_owner",
		"type": "address"
	}, {
		"name": "_itemName",
		"type": "bytes32"
	}],
	"name": "listMultipleItems",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "tokenExists",
	"outputs": [{
		"name": "_exists",
		"type": "bool"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_amount",
		"type": "uint256"
	}],
	"name": "withdrawAmount",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [],
	"name": "name",
	"outputs": [{
		"name": "_name",
		"type": "string"
	}],
	"payable": false,
	"stateMutability": "pure",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_to",
		"type": "address"
	}, {
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "approve",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [],
	"name": "implementsERC721",
	"outputs": [{
		"name": "_implements",
		"type": "bool"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_owner",
		"type": "address"
	}],
	"name": "accountOfP",
	"outputs": [{
		"name": "_nick",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}, {
		"name": "_itemName",
		"type": "bytes32"
	}],
	"name": "setItemName",
	"outputs": [],
	"payable": true,
	"stateMutability": "payable",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_owner",
		"type": "address"
	}],
	"name": "setOwner",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_admin",
		"type": "address"
	}],
	"name": "removeAdmin",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [],
	"name": "totalSupply",
	"outputs": [{
		"name": "_totalSupply",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_itemRegistry",
		"type": "address"
	}],
	"name": "setItemRegistry",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_from",
		"type": "address"
	}, {
		"name": "_to",
		"type": "address"
	}, {
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "transferFrom",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_admin",
		"type": "address"
	}],
	"name": "isAdmin",
	"outputs": [{
		"name": "_isAdmin",
		"type": "bool"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "approvedFor",
	"outputs": [{
		"name": "_approved",
		"type": "address"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "listItemFromRegistry",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_from",
		"type": "uint256"
	}, {
		"name": "_take",
		"type": "uint256"
	}],
	"name": "itemsForSaleLimit",
	"outputs": [{
		"name": "_items",
		"type": "uint256[]"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_owner",
		"type": "address"
	}],
	"name": "tokensOf",
	"outputs": [{
		"name": "_tokenIds",
		"type": "uint256[]"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "nextPriceOf",
	"outputs": [{
		"name": "_nextPrice",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_owner",
		"type": "address"
	}],
	"name": "accountOfN",
	"outputs": [{
		"name": "_nick",
		"type": "string"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "ownerOf",
	"outputs": [{
		"name": "_owner",
		"type": "address"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_price",
		"type": "uint256"
	}],
	"name": "calculateDevCut",
	"outputs": [{
		"name": "_devCut",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_admin",
		"type": "address"
	}],
	"name": "addAdmin",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_owner",
		"type": "address"
	}],
	"name": "balanceOf",
	"outputs": [{
		"name": "_balance",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [],
	"name": "enableERC721",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}, {
		"name": "_price",
		"type": "uint256"
	}, {
		"name": "_owner",
		"type": "address"
	}, {
		"name": "_itemName",
		"type": "bytes32"
	}, {
		"name": "_itemNameAddress",
		"type": "address"
	}],
	"name": "listItem",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "itemNameAddress",
	"outputs": [{
		"name": "_itemNameAddress",
		"type": "address"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [],
	"name": "withdrawAll",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_owner",
		"type": "address"
	}],
	"name": "countryofN",
	"outputs": [{
		"name": "_nick",
		"type": "string"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_itemIds",
		"type": "uint256[]"
	}],
	"name": "populateFromItemRegistry",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [],
	"name": "symbol",
	"outputs": [{
		"name": "_symbol",
		"type": "string"
	}],
	"payable": false,
	"stateMutability": "pure",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_to",
		"type": "address"
	}, {
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "transfer",
	"outputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "startingPriceOf",
	"outputs": [{
		"name": "_startingPrice",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "priceOf",
	"outputs": [{
		"name": "_price",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "buy",
	"outputs": [],
	"payable": true,
	"stateMutability": "payable",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_itemId",
		"type": "uint256"
	}],
	"name": "itemNameOf",
	"outputs": [{
		"name": "_itemName",
		"type": "bytes32"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": true,
	"inputs": [{
		"name": "_price",
		"type": "uint256"
	}],
	"name": "calculateNextPrice",
	"outputs": [{
		"name": "_nextPrice",
		"type": "uint256"
	}],
	"payable": false,
	"stateMutability": "view",
	"type": "function"
}, {
	"constant": false,
	"inputs": [{
		"name": "_nick",
		"type": "string"
	}, {
		"name": "_countryname",
		"type": "string"
	}],
	"name": "setNick",
	"outputs": [],
	"payable": true,
	"stateMutability": "payable",
	"type": "function"
}, {
	"inputs": [],
	"payable": false,
	"stateMutability": "nonpayable",
	"type": "constructor"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"name": "_itemId",
		"type": "uint256"
	}, {
		"indexed": true,
		"name": "_owner",
		"type": "address"
	}, {
		"indexed": false,
		"name": "_price",
		"type": "uint256"
	}],
	"name": "Bought",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"name": "_itemId",
		"type": "uint256"
	}, {
		"indexed": true,
		"name": "_owner",
		"type": "address"
	}, {
		"indexed": false,
		"name": "_price",
		"type": "uint256"
	}],
	"name": "Sold",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"name": "_from",
		"type": "address"
	}, {
		"indexed": true,
		"name": "_to",
		"type": "address"
	}, {
		"indexed": false,
		"name": "_tokenId",
		"type": "uint256"
	}],
	"name": "Transfer",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"name": "_owner",
		"type": "address"
	}, {
		"indexed": true,
		"name": "_approved",
		"type": "address"
	}, {
		"indexed": false,
		"name": "_tokenId",
		"type": "uint256"
	}],
	"name": "Approval",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"name": "_itemId",
		"type": "uint256"
	}, {
		"indexed": true,
		"name": "_owner",
		"type": "address"
	}, {
		"indexed": true,
		"name": "_itemName",
		"type": "bytes32"
	}],
	"name": "ReNameEvent",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"name": "_nick",
		"type": "string"
	}, {
		"indexed": true,
		"name": "_countryName",
		"type": "string"
	}, {
		"indexed": true,
		"name": "_owner",
		"type": "address"
	}],
	"name": "SetNick",
	"type": "event"
}, {
	"anonymous": false,
	"inputs": [{
		"indexed": true,
		"name": "_accountOfPrice",
		"type": "uint256"
	}, {
		"indexed": true,
		"name": "_owner",
		"type": "address"
	}],
	"name": "SetNickPrice",
	"type": "event"
}];

function run() {
	if (typeof web3 == 'undefined') {
		return alert("请在安装了MetaMask插件的Chrome浏览器中打开!")
	};
	a = new Web3(web3.currentProvider).eth;
	a.getAccounts(function(e, f) {
		if (e) {
			console.log(e);
			return alert("没有得到账号")
		};
		console.log(f);
		$('body').append("MetaMask 地址:<br/>" + JSON.stringify(f, null, 4));
		sInfo = "<br/><button onclick='fun_show_info()'>查看合约信息</button>";
		sInfo += "<div class='div_tip'>参数：可看合约名，合约标识，token数量</div>";
		$('body').append(sInfo);
		sInfo = "<br/>参数:<input id='txt_input_1' size='100'>";
		$('body').append(sInfo);
		sInfo = "<br/><button onclick='fun_isAdmin()'>判断管理员</button>";
		sInfo += "<div class='div_tip'>参数：判断指定的账号是不是管理员</div>";
		sInfo += "<div class='div_tip'>参数：地址</div>";
		sInfo += "<div class='div_tip'>例：0x7a85Aae189b72D0440F546582eA9b4Be23aBB40E</div>";
		$('body').append(sInfo);
		sInfo = "<br/><button onclick='fun_listItem()'>新建单个Token</button>";
		sInfo += "<div class='div_tip'>参数：添加单个Token</div>";
		sInfo += "<div class='div_tip'>参数：位置，价格，所有者地址，名称，名称地址</div>";
		sInfo += "<div class='div_tip'>例：1,1000000000000000,0xc994d1A847FeFD4693741dc6149b10a32F17daE2,1name1,0xc994d1A847FeFD4693741dc6149b10a32F17daE2</div>";
		$('body').append(sInfo);
		sInfo = "<br/><button onclick='fun_allOf()'>查看单个Token所有信息</button>";
		sInfo += "<div class='div_tip'>参数：查看单个Token所有信息</div>";
		sInfo += "<div class='div_tip'>参数：tokenId</div>";
		sInfo += "<div class='div_tip'>例：<br>1</div>";
		$('body').append(sInfo);
		sInfo = "<br/><button onclick='fun_setItemName()'>修改指定Token名称</button>";
		sInfo += "<div class='div_tip'>参数：修改指定Token名称</div>";
		sInfo += "<div class='div_tip'>参数：</div>";
		sInfo += "<div class='div_tip'>tokenId,名字</div>";
		sInfo += "<div class='div_tip'>例：";
		sInfo += "<div class='div_tip'>1,1name3";
		$('body').append(sInfo);
		sInfo = "<br/><button onclick='fun_buy()'>购买</button>";
		sInfo += "<div class='div_tip'>参数：购买指定的Token</div>";
		sInfo += "<div class='div_tip'>参数：</div>";
		sInfo += "<div class='div_tip'>tokenId,价格</div>";
		sInfo += "<div class='div_tip'>例：";
		sInfo += "<div class='div_tip'>1,4105263157894736";
		$('body').append(sInfo);
		sInfo = "<br/><button onclick='fun_withdrawAmount()'>取现</button>";
		sInfo += "<div class='div_tip'>参数：取合约指定金额到创建者账号</div>";
		sInfo += "<div class='div_tip'>参数：</div>";
		sInfo += "<div class='div_tip'>金额</div>";
		sInfo += "<div class='div_tip'>例：";
		sInfo += "<div class='div_tip'>1000000000000000";
		$('body').append(sInfo);
		sInfo = "<br/><button onclick='fun_getNick()'>得到账号昵称相关信息</button>";
		sInfo += "<div class='div_tip'>参数：得到指定账号的信息</div>";
		sInfo += "<div class='div_tip'>参数：</div>";
		sInfo += "<div class='div_tip'>账号</div>";
		sInfo += "<div class='div_tip'>例：";
		sInfo += "<div class='div_tip'>0xc994d1A847FeFD4693741dc6149b10a32F17daE2";
		$('body').append(sInfo);
		sInfo = "<br/><button onclick='fun_setNick()'>设置昵称</button>";
		sInfo += "<div class='div_tip'>参数：设置当前账号的昵称和国籍</div>";
		sInfo += "<div class='div_tip'>参数：</div>";
		sInfo += "<div class='div_tip'>价格，昵称，国籍</div>";
		sInfo += "<div class='div_tip'>例：";
		sInfo += "<div class='div_tip'>1000000000000000,username,china";
		$('body').append(sInfo);
		b = f
	})
};
run();

function fun_isAdmin() {
	var e = web3.eth.contract(d).at(c);
	var f = $("#txt_input_1").val();
	console.log(f);
	f = f.toString();
	console.log(f);
	sInfo = "<br/>=====操作-判断是不是管理员=====";
	$('body').append(sInfo);
	e.isAdmin.call(f, function(g, h) {
		sInfo = "<br/>结果：" + h;
		$('body').append(sInfo)
	})
};

function fun_addAdmin() {
	var e = web3.eth.contract(d).at(c);
	var f = $("#txt_input_1").val();
	console.log(f);
	f = f.toString();
	console.log(f);
	sInfo = "<br/>=====操作-添加管理员=====";
	$('body').append(sInfo);
	e.addAdmin.call(f, function(g, h) {
		sInfo = "<br/>结果：" + h;
		$('body').append(sInfo)
	})
};

function fun_show_info() {
	var e = web3.eth.contract(d).at(c);
	sInfo = "<br/>=====操作-查看合约信息=====";
	$('body').append(sInfo);
	e.name.call(function(f, g) {
		sInfo = "<br/>合约名称：" + g;
		$('body').append(sInfo)
	});
	e.symbol.call(function(f, g) {
		sInfo = "<br/>合约符号：" + g;
		$('body').append(sInfo)
	});
	e.totalSupply.call(function(f, g) {
		sInfo = "<br/>合约Token数量：" + g;
		$('body').append(sInfo)
	})
};

function fun_listItem() {
	var e = web3.eth.contract(d).at(c);
	var f = b[0];
	var g = $("#txt_input_1").val();
	console.log(g);
	g = g.toString();
	console.log(g);
	var h = fun_tool_split(g, 5);
	console.log(h);
	if (h == "") {
		alert("参数不符!");
		return
	};
	para1 = h[0];
	para2 = h[1].toString();
	para3 = h[2].toString();
	para4 = h[3].toString();
	para5 = h[4].toString();
	console.log(h);
	console.log(para1);
	console.log(para2);
	console.log(para3);
	console.log(para4);
	console.log(para5);
	sInfo = "<br/>=====操作-新建单个token=====";
	$('body').append(sInfo);
	var i = {
		from: f,
	};
	console.log(i);
	console.log(e);
	e.listItem.sendTransaction(para1, para2, para3, para4, para5, function(j, k) {
		if (j) {
			console.log(j);
			return alert("发送交易失败!")
		};
		console.log(k);
		$('body').append('<br/>交易hash:<a href="https://ropsten.etherscan.io/tx/' + k + '">' + k + '<>')
	})
};

function fun_allOf() {
	var e = web3.eth.contract(d).at(c);
	var f = $("#txt_input_1").val();
	console.log(f);
	f = f.toString();
	console.log(f);
	sInfo = "<br/>=====操作-查看单个Token所有信息=====";
	$('body').append(sInfo);
	e.startingPriceOf.call(f, function(g, h) {
		sInfo = "<br/>开始价格：" + h;
		$('body').append(sInfo)
	});
	e.priceOf.call(f, function(g, h) {
		sInfo = "<br/>现在价格：" + h;
		$('body').append(sInfo)
	});
	e.ownerOf.call(f, function(g, h) {
		sInfo = "<br/>所有者：" + h;
		$('body').append(sInfo)
	});
	e.nextPriceOf.call(f, function(g, h) {
		sInfo = "<br/>下一次：" + h;
		$('body').append(sInfo)
	});
	e.itemNameOf.call(f, function(g, h) {
		sInfo = "<br/>名称：" + h;
		$('body').append(sInfo)
	});
	e.itemNameAddress.call(f, function(g, h) {
		sInfo = "<br/>名称地址：" + h;
		$('body').append(sInfo)
	})
};

function fun_getNick() {
	var e = web3.eth.contract(d).at(c);
	var f = b[0];
	var g = $("#txt_input_1").val();
	console.log(g);
	g = g.toString();
	console.log(g);
	var h = fun_tool_split(g, 1);
	console.log(h);
	if (h == "") {
		alert("参数不符!");
		return
	};
	para1 = h[0].toString();
	console.log(h);
	console.log(para1);
	sInfo = "<br/>=====操作-得到账号昵称相关信息=====";
	$('body').append(sInfo);
	e.accountOfN.call(para1, function(i, j) {
		sInfo = "<br/>账号昵称：" + j;
		$('body').append(sInfo)
	});
	e.accountOfP.call(para1, function(i, j) {
		sInfo = "<br/>账号修改价格：" + j;
		$('body').append(sInfo)
	});
	e.countryofN.call(para1, function(i, j) {
		sInfo = "<br/>账号国籍：" + j;
		$('body').append(sInfo)
	})
};

function fun_setItemName() {
	var e = web3.eth.contract(d).at(c);
	var f = $("#txt_input_1").val();
	console.log(f);
	f = f.toString();
	console.log(f);
	var g = fun_tool_split(f, 3);
	console.log(g);
	if (g == "") {
		alert("参数不符!");
		return
	};
	para1 = g[0];
	para2 = g[1].toString();
	para3 = g[2].toString();
	console.log(g);
	console.log(para1);
	console.log(para2);
	console.log(para3);
	sInfo = "<br/>=====操作-修改Token名字=====";
	$('body').append(sInfo);
	var h = {
		value: para1,
	};
	e.setItemName.sendTransaction(para2, para3, h, function(i, j) {
		if (i) {
			console.log(i);
			return alert("发送交易失败!")
		};
		console.log(j);
		$('body').append('<br/>交易hash:<a href="https://ropsten.etherscan.io/tx/' + j + '">' + j + '<>')
	});
};

function fun_buy() {
	var e = web3.eth.contract(d).at(c);
	var f = b[0];
	var g = $("#txt_input_1").val();
	console.log(g);
	g = g.toString();
	console.log(g);
	var h = fun_tool_split(g, 2);
	console.log(h);
	if (h == "") {
		alert("参数不符!");
		return
	};
	para1 = h[0];
	para2 = h[1];
	console.log(h);
	console.log(para1);
	console.log(para2);
	sInfo = "<br/>=====操作-新建单个token=====";
	$('body').append(sInfo);
	var i = {
		from: f,
		value: para2,
	};
	console.log(i);
	e.buy.sendTransaction(para1, i, function(j, k) {
		if (j) {
			console.log(j);
			return alert("发送交易失败!")
		};
		console.log(k);
		$('body').append('<br/>交易hash:<a href="https://ropsten.etherscan.io/tx/' + k + '">' + k + '<>')
	});
};

function fun_withdrawAmount() {
	var e = web3.eth.contract(d).at(c);
	var f = b[0];
	var g = $("#txt_input_1").val();
	console.log(g);
	g = g.toString();
	console.log(g);
	var h = fun_tool_split(g, 1);
	console.log(h);
	if (h == "") {
		alert("参数不符!");
		return
	};
	para1 = h[0];
	console.log(h);
	console.log(para1);
	sInfo = "<br/>=====操作-取合约指定金额到创建者账号=====";
	$('body').append(sInfo);
	var i = {};
	console.log(i);
	e.withdrawAmount.sendTransaction(para1, i, function(j, k) {
		if (j) {
			console.log(j);
			return alert("发送交易失败!")
		};
		console.log(k);
		$('body').append('<br/>交易hash:<a href="https://ropsten.etherscan.io/tx/' + k + '">' + k + '<>')
	});
};

function fun_setNick() {
	var e = web3.eth.contract(d).at(c);
	var f = $("#txt_input_1").val();
	console.log(f);
	f = f.toString();
	console.log(f);
	var g = fun_tool_split(f, 3);
	console.log(g);
	if (g == "") {
		alert("参数不符!");
		return
	};
	para1 = g[0].toString();
	para2 = g[1].toString();
	para3 = g[2].toString();
	console.log(g);
	console.log(para1);
	console.log(para2);
	console.log(para3);
	sInfo = "<br/>=====操作-修改账号昵称=====";
	$('body').append(sInfo);
	var h = {
		value: para1,
	};
	e.setNick.sendTransaction(para2, para3, h, function(i, j) {
		if (i) {
			console.log(i);
			return alert("发送交易失败!")
		};
		console.log(j);
		$('body').append('<br/>交易hash:<a href="https://ropsten.etherscan.io/tx/' + j + '">' + j + '<>')
	});
};

function fun_tool_split(e, f) {
	var g = e.split(",");
	if (f != g.length) {
		return ""
	};
	return g
};

function fun_tool_watch(e) {
	var f = e;
	f.watch(function(g, h) {
		if (!g) {
			console.log(h)
		} else {
			console.log(g)
		};
		f.stopWatching()
	})
}